#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int d[25], sz;
ll dp[N][2][2][10];
void init_d(ll n) {
  sz = 0;
  while (n) {
    d[++sz] = n % 10;
    n /= 10;
  }
}
ll dfs(int s, int lead, int limit, int mx) {  // mx : leading digit
  if (s == 0) return 1;
  if (!lead && !mx) return 0;
  if (dp[s][lead][limit][mx] != -1) return dp[s][lead][limit][mx];
  ll& ans = dp[s][lead][limit][mx];
  if (!lead && !limit) {
    ans = 1;
    rep(i, 1, s) ans *= mx;
    return ans;
  }
  ans = 0;
  int imx = limit ? d[s] : 9;
  if (!lead) imx = min(imx, mx - 1);
  rep(i, 0, imx) {
    int nlead = lead && i == 0;
    int nlimit = limit && i == d[s];
    int nmx = lead ? i : mx;
    ans += dfs(s - 1, nlead, nlimit, nmx);
  }
  return ans;
}
ll solve(ll n) {
  if (n < 9) n = 9;
  init_d(n);
  memset(dp, -1, sizeof(dp));
  return dfs(sz, 1, 1, 0);
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ll L, R;
  cin >> L >> R;
  cout << solve(R) - solve(L - 1);
  return 0;
}